/**
 * 
 */
package com.app.service.impl.ajaxservice;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.app.service.BaseService;
import com.app.service.IAjaxService;
import com.app.service.vo.RuleCVo;

/**
 * @author Administrator
 * 取得当前角色已经绑定的权限id
 */
public class RuleComptenceCheckedImpl extends BaseService implements
		IAjaxService {

	/* (non-Javadoc)
	 * @see com.app.service.IAjaxService#execute(javax.servlet.http.HttpServletRequest)
	 */
	@SuppressWarnings("unchecked")
	@Override
	public Map<?, ?> execute(HttpServletRequest request) {
		// TODO Auto-generated method stub
		Map<String,List<String>> params = new HashMap<String,List<String>>();
		List<RuleCVo> volist   = (List<RuleCVo>) this.getCacheService().getObject("c-r-list");
		List<String>  competencelist= new ArrayList<String>();
		String ruleid = request.getParameter("ruleid");
		for(RuleCVo vo:volist)
		{
			if(vo.getRoleId().equals(ruleid))
			{
				competencelist.add(vo.getCompetenceId());
			}
		}
		params.put("checkeds", competencelist);
		return params;
	}

}
